﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.SceneManagement;

//用户数据
public   class UserData :Singleton<UserData>
{
    //假的角色数据
    public  List<SelectRoleInfo> AllRole = new List<SelectRoleInfo>();

    public  UserData()
    {
       
    }

    internal static void OnRoleList(Cmd cmd)
    {
        //cmd的类型必须是RoleListCmd
        if (!Net.CheckCmd(cmd, typeof(RoleListCmd))) { return; }
        RoleListCmd roleListCmd = cmd as RoleListCmd;
        UserData.instance.AllRole = roleListCmd.AllRole;
        if (roleListCmd.AllRole.Count>0)
        {
            //选人界面
            SceneManager.LoadScene("SelectRole");
        }
        else
        {
            //创建角色界面
            SceneManager.LoadScene("CreatRole");
        }
    }
}
